#pragma once
// MESSAGE KF_OTHER PACKING

#define MAVLINK_MSG_ID_KF_OTHER 30

MAVPACKED(
typedef struct __mavlink_kf_other_t {
 float Data[60]; /*<  data*/
}) mavlink_kf_other_t;

#define MAVLINK_MSG_ID_KF_OTHER_LEN 240
#define MAVLINK_MSG_ID_KF_OTHER_MIN_LEN 240
#define MAVLINK_MSG_ID_30_LEN 240
#define MAVLINK_MSG_ID_30_MIN_LEN 240

#define MAVLINK_MSG_ID_KF_OTHER_CRC 138
#define MAVLINK_MSG_ID_30_CRC 138

#define MAVLINK_MSG_KF_OTHER_FIELD_DATA_LEN 60

#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_KF_OTHER { \
    30, \
    "KF_OTHER", \
    1, \
    {  { "Data", NULL, MAVLINK_TYPE_FLOAT, 60, 0, offsetof(mavlink_kf_other_t, Data) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_KF_OTHER { \
    "KF_OTHER", \
    1, \
    {  { "Data", NULL, MAVLINK_TYPE_FLOAT, 60, 0, offsetof(mavlink_kf_other_t, Data) }, \
         } \
}
#endif

/**
 * @brief Pack a kf_other message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param Data  data
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_kf_other_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               const float *Data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_KF_OTHER_LEN];

    _mav_put_float_array(buf, 0, Data, 60);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_KF_OTHER_LEN);
#else
    mavlink_kf_other_t packet;

    mav_array_memcpy(packet.Data, Data, sizeof(float)*60);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_KF_OTHER_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_KF_OTHER;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
}

/**
 * @brief Pack a kf_other message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param Data  data
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_kf_other_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   const float *Data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_KF_OTHER_LEN];

    _mav_put_float_array(buf, 0, Data, 60);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_KF_OTHER_LEN);
#else
    mavlink_kf_other_t packet;

    mav_array_memcpy(packet.Data, Data, sizeof(float)*60);
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_KF_OTHER_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_KF_OTHER;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
}

/**
 * @brief Encode a kf_other struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param kf_other C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_kf_other_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_kf_other_t* kf_other)
{
    return mavlink_msg_kf_other_pack(system_id, component_id, msg, kf_other->Data);
}

/**
 * @brief Encode a kf_other struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param kf_other C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_kf_other_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_kf_other_t* kf_other)
{
    return mavlink_msg_kf_other_pack_chan(system_id, component_id, chan, msg, kf_other->Data);
}

/**
 * @brief Send a kf_other message
 * @param chan MAVLink channel to send the message
 *
 * @param Data  data
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_kf_other_send(mavlink_channel_t chan, const float *Data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_KF_OTHER_LEN];

    _mav_put_float_array(buf, 0, Data, 60);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_KF_OTHER, buf, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
#else
    mavlink_kf_other_t packet;

    mav_array_memcpy(packet.Data, Data, sizeof(float)*60);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_KF_OTHER, (const char *)&packet, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
#endif
}

/**
 * @brief Send a kf_other message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_kf_other_send_struct(mavlink_channel_t chan, const mavlink_kf_other_t* kf_other)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_kf_other_send(chan, kf_other->Data);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_KF_OTHER, (const char *)kf_other, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
#endif
}

#if MAVLINK_MSG_ID_KF_OTHER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_kf_other_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  const float *Data)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;

    _mav_put_float_array(buf, 0, Data, 60);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_KF_OTHER, buf, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
#else
    mavlink_kf_other_t *packet = (mavlink_kf_other_t *)msgbuf;

    mav_array_memcpy(packet->Data, Data, sizeof(float)*60);
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_KF_OTHER, (const char *)packet, MAVLINK_MSG_ID_KF_OTHER_MIN_LEN, MAVLINK_MSG_ID_KF_OTHER_LEN, MAVLINK_MSG_ID_KF_OTHER_CRC);
#endif
}
#endif

#endif

// MESSAGE KF_OTHER UNPACKING


/**
 * @brief Get field Data from kf_other message
 *
 * @return  data
 */
static inline uint16_t mavlink_msg_kf_other_get_Data(const mavlink_message_t* msg, float *Data)
{
    return _MAV_RETURN_float_array(msg, Data, 60,  0);
}

/**
 * @brief Decode a kf_other message into a struct
 *
 * @param msg The message to decode
 * @param kf_other C-struct to decode the message contents into
 */
static inline void mavlink_msg_kf_other_decode(const mavlink_message_t* msg, mavlink_kf_other_t* kf_other)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_kf_other_get_Data(msg, kf_other->Data);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_KF_OTHER_LEN? msg->len : MAVLINK_MSG_ID_KF_OTHER_LEN;
        memset(kf_other, 0, MAVLINK_MSG_ID_KF_OTHER_LEN);
    memcpy(kf_other, _MAV_PAYLOAD(msg), len);
#endif
}
